--- llama.cpp/llama-bench/llama-bench.cpp
+++ llama.cpp/llama-bench/llama-bench.cpp
@@ -1,7 +1,10 @@
+// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-
+// vi: set et ft=cpp ts=4 sts=4 sw=4 fenc=utf-8 :vi
+
 #include <algorithm>
 #include <array>
 #include <cassert>
-#include <chrono>
+// #include <chrono> [jart]
 #include <cinttypes>
 #include <clocale>
 #include <cmath>
@@ -16,24 +19,20 @@
 #include <sstream>
 #include <string>
 #include <vector>
-
-#include "ggml.h"
-#include "llama.h"
-#include "common.h"
-#include "ggml-cuda.h"
-#include "ggml-sycl.h"
-
-#ifdef GGML_USE_CANN
-#include "ggml-cann.h"
-#endif
-
-#ifdef _WIN32
-#define WIN32_LEAN_AND_MEAN
-#ifndef NOMINMAX
-#   define NOMINMAX
-#endif
-#include <windows.h>
-#endif
+#include <cosmo.h>
+#include <libgen.h>
+#include <sys/stat.h>
+#include <libc/intrin/x86.h>
+#include "llama.cpp/cores.h"
+#include <libc/sysv/consts/hwcap.h>
+
+#include "llama.cpp/ggml.h"
+#include "llama.cpp/llama.h"
+#include "llama.cpp/string.h"
+#include "llama.cpp/common.h"
+#include "llama.cpp/ggml-cuda.h"
+#include "llamafile/llamafile.h"
+#include "llamafile/compute.h"

 // utils
 static uint64_t get_time_ns() {
@@ -53,6 +52,20 @@ static std::string join(const std::vector<T> & values, const std::string & delim
     return str.str();
 }

+template<class T>
+static std::vector<T> split(const std::string & str, char delim) {
+    std::vector<T> values;
+    std::istringstream str_stream(str);
+    std::string token;
+    while (std::getline(str_stream, token, delim)) {
+        T value;
+        std::istringstream token_stream(token);
+        token_stream >> value;
+        values.push_back(value);
+    }
+    return values;
+}
+
 template<typename T, typename F>
 static std::vector<std::string> transform_to_str(const std::vector<T> & values, F f) {
     std::vector<std::string> str_values;
@@ -80,56 +93,6 @@ static T stdev(const std::vector<T> & v) {
     return stdev;
 }

-static std::string get_cpu_info() {
-    std::string id;
-#ifdef __linux__
-    FILE * f = fopen("/proc/cpuinfo", "r");
-    if (f) {
-        char buf[1024];
-        while (fgets(buf, sizeof(buf), f)) {
-            if (strncmp(buf, "model name", 10) == 0) {
-                char * p = strchr(buf, ':');
-                if (p) {
-                    p++;
-                    while (std::isspace(*p)) {
-                        p++;
-                    }
-                    while (std::isspace(p[strlen(p) - 1])) {
-                        p[strlen(p) - 1] = '\0';
-                    }
-                    id = p;
-                    break;
-                }
-            }
-        }
-        fclose(f);
-    }
-#elif defined(_WIN32)
-    HKEY hKey;
-    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
-                     TEXT("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0"),
-                     0,
-                     KEY_READ,
-                     &hKey) != ERROR_SUCCESS) {
-        // fail to open registry key
-        return "";
-    }
-    char cpu_brand[256];
-    DWORD cpu_brand_size = sizeof(cpu_brand);
-    if (RegQueryValueExA(hKey,
-                        TEXT("ProcessorNameString"),
-                        NULL,
-                        NULL,
-                        (LPBYTE)cpu_brand,
-                        &cpu_brand_size) == ERROR_SUCCESS) {
-        id.assign(cpu_brand, cpu_brand_size);
-    }
-    RegCloseKey(hKey);
-#endif
-    // TODO: other platforms
-    return id;
-}
-
 static std::string get_gpu_info() {
     std::string id;
 #ifdef GGML_USE_CUDA
@@ -153,51 +116,22 @@ static std::string get_gpu_info() {
             id += "/";
         }
     }
-#endif
-#ifdef GGML_USE_CANN
-    uint32_t count = ggml_backend_cann_get_device_count();
-    for (uint32_t i = 0; i < count; i++) {
-        char buf[128];
-        ggml_backend_cann_get_device_description(i, buf, sizeof(buf));
-        id += buf;
-        if (i < count - 1) {
-            id += "/";
-        }
-    }
 #endif
     // TODO: other backends
     return id;
 }

 // command line params
-enum output_formats {NONE, CSV, JSON, MARKDOWN, SQL};
+enum output_formats {CSV, JSON, MARKDOWN, SQL};

 static const char * output_format_str(output_formats format) {
     switch (format) {
-        case NONE:     return "none";
         case CSV:      return "csv";
         case JSON:     return "json";
         case MARKDOWN: return "md";
         case SQL:      return "sql";
-        default: GGML_ABORT("invalid output format");
-    }
-}
-
-static bool output_format_from_str(const std::string & s, output_formats & format) {
-    if (s == "none") {
-        format = NONE;
-    } else if (s == "csv") {
-        format = CSV;
-    } else if (s == "json") {
-        format = JSON;
-    } else if (s == "md") {
-        format = MARKDOWN;
-    } else if (s == "sql") {
-        format = SQL;
-    } else {
-        return false;
+        default: GGML_ASSERT(!"invalid output format");
     }
-    return true;
 }

 static const char * split_mode_str(llama_split_mode mode) {
@@ -205,7 +139,7 @@ static const char * split_mode_str(llama_split_mode mode) {
         case LLAMA_SPLIT_MODE_NONE:  return "none";
         case LLAMA_SPLIT_MODE_LAYER: return "layer";
         case LLAMA_SPLIT_MODE_ROW:   return "row";
-        default: GGML_ABORT("invalid split mode");
+        default: GGML_ASSERT(!"invalid split mode");
     }
 }

@@ -226,7 +160,6 @@ struct cmd_params {
     std::vector<ggml_type> type_v;
     std::vector<int> n_threads;
     std::vector<int> n_gpu_layers;
-    std::vector<std::string> rpc_servers;
     std::vector<llama_split_mode> split_mode;
     std::vector<int> main_gpu;
     std::vector<bool> no_kv_offload;
@@ -238,33 +171,30 @@ struct cmd_params {
     int reps;
     bool verbose;
     output_formats output_format;
-    output_formats output_format_stderr;
 };

 static const cmd_params cmd_params_defaults = {
-    /* model                */ {"models/7B/ggml-model-q4_0.gguf"},
-    /* n_prompt             */ {512},
-    /* n_gen                */ {128},
-    /* n_pg                 */ {},
-    /* n_batch              */ {2048},
-    /* n_ubatch             */ {512},
-    /* type_k               */ {GGML_TYPE_F16},
-    /* type_v               */ {GGML_TYPE_F16},
-    /* n_threads            */ {cpu_get_num_math()},
-    /* n_gpu_layers         */ {99},
-    /* rpc_servers          */ {""},
-    /* split_mode           */ {LLAMA_SPLIT_MODE_LAYER},
-    /* main_gpu             */ {0},
-    /* no_kv_offload        */ {false},
-    /* flash_attn           */ {false},
-    /* tensor_split         */ {std::vector<float>(llama_max_devices(), 0.0f)},
-    /* use_mmap             */ {true},
-    /* embeddings           */ {false},
-    /* numa                 */ GGML_NUMA_STRATEGY_DISABLED,
-    /* reps                 */ 5,
-    /* verbose              */ false,
-    /* output_format        */ MARKDOWN,
-    /* output_format_stderr */ NONE,
+    /* model         */ {}, // [jart] no default guessing
+    /* n_prompt      */ {512},
+    /* n_gen         */ {16},
+    /* n_pg          */ {},
+    /* n_batch       */ {2048},
+    /* n_ubatch      */ {512},
+    /* type_k        */ {X86_HAVE(AVX512_BF16) ? GGML_TYPE_BF16 : GGML_TYPE_F16},
+    /* type_v        */ {X86_HAVE(AVX512_BF16) ? GGML_TYPE_BF16 : GGML_TYPE_F16},
+    /* n_threads     */ {cpu_get_num_math()},
+    /* n_gpu_layers  */ {0},
+    /* split_mode    */ {LLAMA_SPLIT_MODE_LAYER},
+    /* main_gpu      */ {0},
+    /* no_kv_offload */ {false},
+    /* flash_attn    */ {false},
+    /* tensor_split  */ {std::vector<float>(llama_max_devices(), 0.0f)},
+    /* use_mmap      */ {true},
+    /* embeddings    */ {false},
+    /* numa          */ GGML_NUMA_STRATEGY_DISABLED,
+    /* reps          */ 3,
+    /* verbose       */ false,
+    /* output_format */ MARKDOWN
 };

 static void print_usage(int /* argc */, char ** argv) {
@@ -282,7 +212,6 @@ static void print_usage(int /* argc */, char ** argv) {
     printf("  -ctv, --cache-type-v <t>            (default: %s)\n", join(transform_to_str(cmd_params_defaults.type_v, ggml_type_name), ",").c_str());
     printf("  -t, --threads <n>                   (default: %s)\n", join(cmd_params_defaults.n_threads, ",").c_str());
     printf("  -ngl, --n-gpu-layers <n>            (default: %s)\n", join(cmd_params_defaults.n_gpu_layers, ",").c_str());
-    printf("  -rpc, --rpc <rpc_servers>           (default: %s)\n", join(cmd_params_defaults.rpc_servers, ",").c_str());
     printf("  -sm, --split-mode <none|layer|row>  (default: %s)\n", join(transform_to_str(cmd_params_defaults.split_mode, split_mode_str), ",").c_str());
     printf("  -mg, --main-gpu <i>                 (default: %s)\n", join(cmd_params_defaults.main_gpu, ",").c_str());
     printf("  -nkvo, --no-kv-offload <0|1>        (default: %s)\n", join(cmd_params_defaults.no_kv_offload, ",").c_str());
@@ -293,7 +222,6 @@ static void print_usage(int /* argc */, char ** argv) {
     printf("  -ts, --tensor-split <ts0/ts1/..>    (default: 0)\n");
     printf("  -r, --repetitions <n>               (default: %d)\n", cmd_params_defaults.reps);
     printf("  -o, --output <csv|json|md|sql>      (default: %s)\n", output_format_str(cmd_params_defaults.output_format));
-    printf("  -oe, --output-err <csv|json|md|sql> (default: %s)\n", output_format_str(cmd_params_defaults.output_format_stderr));
     printf("  -v, --verbose                       (default: %s)\n", cmd_params_defaults.verbose ? "1" : "0");
     printf("\n");
     printf("Multiple values can be given for each parameter by separating them with ',' or by specifying the parameter multiple times.\n");
@@ -335,14 +263,12 @@ static cmd_params parse_cmd_params(int argc, char ** argv) {

     params.verbose = cmd_params_defaults.verbose;
     params.output_format = cmd_params_defaults.output_format;
-    params.output_format_stderr = cmd_params_defaults.output_format_stderr;
     params.reps = cmd_params_defaults.reps;
-    params.numa = cmd_params_defaults.numa;

     for (int i = 1; i < argc; i++) {
         arg = argv[i];
         if (arg.compare(0, arg_prefix.size(), arg_prefix) == 0) {
-            std::replace(arg.begin(), arg.end(), '_', '-');
+            std::replace (arg.begin(), arg.end(), '_', '-');
         }

         if (arg == "-h" || arg == "--help") {
@@ -353,28 +279,28 @@ static cmd_params parse_cmd_params(int argc, char ** argv) {
                 invalid_param = true;
                 break;
             }
-            auto p = string_split<std::string>(argv[i], split_delim);
+            auto p = split<std::string>(argv[i], split_delim);
             params.model.insert(params.model.end(), p.begin(), p.end());
         } else if (arg == "-p" || arg == "--n-prompt") {
             if (++i >= argc) {
                 invalid_param = true;
                 break;
             }
-            auto p = string_split<int>(argv[i], split_delim);
+            auto p = split<int>(argv[i], split_delim);
             params.n_prompt.insert(params.n_prompt.end(), p.begin(), p.end());
         } else if (arg == "-n" || arg == "--n-gen") {
             if (++i >= argc) {
                 invalid_param = true;
                 break;
             }
-            auto p = string_split<int>(argv[i], split_delim);
+            auto p = split<int>(argv[i], split_delim);
             params.n_gen.insert(params.n_gen.end(), p.begin(), p.end());
         } else if (arg == "-pg") {
             if (++i >= argc) {
                 invalid_param = true;
                 break;
             }
-            auto p = string_split<std::string>(argv[i], ',');
+            auto p = split<std::string>(argv[i], ',');
             if (p.size() != 2) {
                 invalid_param = true;
                 break;
@@ -385,21 +311,21 @@ static cmd_params parse_cmd_params(int argc, char ** argv) {
                 invalid_param = true;
                 break;
             }
-            auto p = string_split<int>(argv[i], split_delim);
+            auto p = split<int>(argv[i], split_delim);
             params.n_batch.insert(params.n_batch.end(), p.begin(), p.end());
         } else if (arg == "-ub" || arg == "--ubatch-size") {
             if (++i >= argc) {
                 invalid_param = true;
                 break;
             }
-            auto p = string_split<int>(argv[i], split_delim);
+            auto p = split<int>(argv[i], split_delim);
             params.n_ubatch.insert(params.n_ubatch.end(), p.begin(), p.end());
         } else if (arg == "-ctk" || arg == "--cache-type-k") {
             if (++i >= argc) {
                 invalid_param = true;
                 break;
             }
-            auto p = string_split<std::string>(argv[i], split_delim);
+            auto p = split<std::string>(argv[i], split_delim);
             std::vector<ggml_type> types;
             for (const auto & t : p) {
                 ggml_type gt = ggml_type_from_name(t);
@@ -415,7 +341,7 @@ static cmd_params parse_cmd_params(int argc, char ** argv) {
                 invalid_param = true;
                 break;
             }
-            auto p = string_split<std::string>(argv[i], split_delim);
+            auto p = split<std::string>(argv[i], split_delim);
             std::vector<ggml_type> types;
             for (const auto & t : p) {
                 ggml_type gt = ggml_type_from_name(t);
@@ -431,27 +357,22 @@ static cmd_params parse_cmd_params(int argc, char ** argv) {
                 invalid_param = true;
                 break;
             }
-            auto p = string_split<int>(argv[i], split_delim);
+            auto p = split<int>(argv[i], split_delim);
             params.n_threads.insert(params.n_threads.end(), p.begin(), p.end());
         } else if (arg == "-ngl" || arg == "--n-gpu-layers") {
             if (++i >= argc) {
                 invalid_param = true;
                 break;
             }
-            auto p = string_split<int>(argv[i], split_delim);
+            FLAG_gpu = LLAMAFILE_GPU_AUTO;
+            auto p = split<int>(argv[i], split_delim);
             params.n_gpu_layers.insert(params.n_gpu_layers.end(), p.begin(), p.end());
-        } else if (arg == "-rpc" || arg == "--rpc") {
-            if (++i >= argc) {
-                invalid_param = true;
-                break;
-            }
-            params.rpc_servers.push_back(argv[i]);
         } else if (arg == "-sm" || arg == "--split-mode") {
             if (++i >= argc) {
                 invalid_param = true;
                 break;
             }
-            auto p = string_split<std::string>(argv[i], split_delim);
+            auto p = split<std::string>(argv[i], split_delim);
             std::vector<llama_split_mode> modes;
             for (const auto & m : p) {
                 llama_split_mode mode;
@@ -473,13 +394,13 @@ static cmd_params parse_cmd_params(int argc, char ** argv) {
                 invalid_param = true;
                 break;
             }
-            params.main_gpu = string_split<int>(argv[i], split_delim);
+            params.main_gpu = split<int>(argv[i], split_delim);
         } else if (arg == "-nkvo" || arg == "--no-kv-offload") {
             if (++i >= argc) {
                 invalid_param = true;
                 break;
             }
-            auto p = string_split<bool>(argv[i], split_delim);
+            auto p = split<bool>(argv[i], split_delim);
             params.no_kv_offload.insert(params.no_kv_offload.end(), p.begin(), p.end());
         } else if (arg == "--numa") {
             if (++i >= argc) {
@@ -497,28 +418,28 @@ static cmd_params parse_cmd_params(int argc, char ** argv) {
                 invalid_param = true;
                 break;
             }
-            auto p = string_split<bool>(argv[i], split_delim);
+            auto p = split<bool>(argv[i], split_delim);
             params.flash_attn.insert(params.flash_attn.end(), p.begin(), p.end());
         } else if (arg == "-mmp" || arg == "--mmap") {
             if (++i >= argc) {
                 invalid_param = true;
                 break;
             }
-            auto p = string_split<bool>(argv[i], split_delim);
+            auto p = split<bool>(argv[i], split_delim);
             params.use_mmap.insert(params.use_mmap.end(), p.begin(), p.end());
         } else if (arg == "-embd" || arg == "--embeddings") {
             if (++i >= argc) {
                 invalid_param = true;
                 break;
             }
-            auto p = string_split<bool>(argv[i], split_delim);
+            auto p = split<bool>(argv[i], split_delim);
             params.embeddings.insert(params.embeddings.end(), p.begin(), p.end());
         } else if (arg == "-ts" || arg == "--tensor-split") {
             if (++i >= argc) {
                 invalid_param = true;
                 break;
             }
-            for (auto ts : string_split<std::string>(argv[i], split_delim)) {
+            for (auto ts : split<std::string>(argv[i], split_delim)) {
                 // split string by ; and /
                 const std::regex regex{R"([;/]+)"};
                 std::sregex_token_iterator it{ts.begin(), ts.end(), regex, -1};
@@ -546,26 +467,52 @@ static cmd_params parse_cmd_params(int argc, char ** argv) {
                 invalid_param = true;
                 break;
             }
-            invalid_param = !output_format_from_str(argv[i], params.output_format);
-        } else if (arg == "-oe" || arg == "--output-err") {
-            if (++i >= argc) {
+            if (argv[i] == std::string("csv")) {
+                params.output_format = CSV;
+            } else if (argv[i] == std::string("json")) {
+                params.output_format = JSON;
+            } else if (argv[i] == std::string("md")) {
+                params.output_format = MARKDOWN;
+            } else if (argv[i] == std::string("sql")) {
+                params.output_format = SQL;
+            } else {
                 invalid_param = true;
                 break;
             }
-            invalid_param = !output_format_from_str(argv[i], params.output_format_stderr);
         } else if (arg == "-v" || arg == "--verbose") {
             params.verbose = true;
-        } else {
+        } else if (arg[0] == '-') {
             invalid_param = true;
             break;
+        } else {
+            // [jart] let me glob without needing -m flag
+            auto p = split<std::string>(argv[i], split_delim);
+            params.model.insert(params.model.end(), p.begin(), p.end());
         }
     }
     if (invalid_param) {
-        fprintf(stderr, "error: invalid parameter for argument: %s\n", arg.c_str());
-        print_usage(argc, argv);
+        fprintf(stderr, "%s: invalid parameter for argument: %s\n", program_invocation_name, arg.c_str());
+        exit(1);
+    }
+    if (params.model.empty()) {
+        fprintf(stderr, "%s: missing operand\n", program_invocation_name, arg.c_str());
         exit(1);
     }

+    // [jart] sort larger models first
+    std::sort(params.model.begin(), params.model.end(), [](const std::string& a, const std::string& b) {
+        struct stat statA, statB;
+        if (stat(a.c_str(), &statA)) {
+            perror(a.c_str());
+            exit(1);
+        }
+        if (stat(b.c_str(), &statB)) {
+            perror(b.c_str());
+            exit(1);
+        }
+        return statA.st_size > statB.st_size;
+    });
+
     // set defaults
     if (params.model.empty())        { params.model = cmd_params_defaults.model; }
     if (params.n_prompt.empty())     { params.n_prompt = cmd_params_defaults.n_prompt; }
@@ -576,7 +523,6 @@ static cmd_params parse_cmd_params(int argc, char ** argv) {
     if (params.type_k.empty())       { params.type_k = cmd_params_defaults.type_k; }
     if (params.type_v.empty())       { params.type_v = cmd_params_defaults.type_v; }
     if (params.n_gpu_layers.empty()) { params.n_gpu_layers = cmd_params_defaults.n_gpu_layers; }
-    if (params.rpc_servers.empty())  { params.rpc_servers = cmd_params_defaults.rpc_servers; }
     if (params.split_mode.empty())   { params.split_mode = cmd_params_defaults.split_mode; }
     if (params.main_gpu.empty())     { params.main_gpu = cmd_params_defaults.main_gpu; }
     if (params.no_kv_offload.empty()){ params.no_kv_offload = cmd_params_defaults.no_kv_offload; }
@@ -599,7 +545,6 @@ struct cmd_params_instance {
     ggml_type type_v;
     int n_threads;
     int n_gpu_layers;
-    std::string rpc_servers;
     llama_split_mode split_mode;
     int main_gpu;
     bool no_kv_offload;
@@ -612,9 +557,6 @@ struct cmd_params_instance {
         llama_model_params mparams = llama_model_default_params();

         mparams.n_gpu_layers = n_gpu_layers;
-        if (!rpc_servers.empty()) {
-            mparams.rpc_servers = rpc_servers.c_str();
-        }
         mparams.split_mode = split_mode;
         mparams.main_gpu = main_gpu;
         mparams.tensor_split = tensor_split.data();
@@ -626,7 +568,6 @@ struct cmd_params_instance {
     bool equal_mparams(const cmd_params_instance & other) const {
         return model == other.model &&
                n_gpu_layers == other.n_gpu_layers &&
-               rpc_servers == other.rpc_servers &&
                split_mode == other.split_mode &&
                main_gpu == other.main_gpu &&
                use_mmap == other.use_mmap &&
@@ -655,7 +596,6 @@ static std::vector<cmd_params_instance> get_cmd_params_instances(const cmd_param
     // this ordering minimizes the number of times that each model needs to be reloaded
     for (const auto & m : params.model)
     for (const auto & nl : params.n_gpu_layers)
-    for (const auto & rpc : params.rpc_servers)
     for (const auto & sm : params.split_mode)
     for (const auto & mg : params.main_gpu)
     for (const auto & ts : params.tensor_split)
@@ -682,7 +622,6 @@ static std::vector<cmd_params_instance> get_cmd_params_instances(const cmd_param
                 /* .type_v       = */ tv,
                 /* .n_threads    = */ nt,
                 /* .n_gpu_layers = */ nl,
-                /* .rpc_servers  = */ rpc,
                 /* .split_mode   = */ sm,
                 /* .main_gpu     = */ mg,
                 /* .no_kv_offload= */ nkvo,
@@ -708,7 +647,6 @@ static std::vector<cmd_params_instance> get_cmd_params_instances(const cmd_param
                 /* .type_v       = */ tv,
                 /* .n_threads    = */ nt,
                 /* .n_gpu_layers = */ nl,
-                /* .rpc_servers  = */ rpc,
                 /* .split_mode   = */ sm,
                 /* .main_gpu     = */ mg,
                 /* .no_kv_offload= */ nkvo,
@@ -734,7 +672,6 @@ static std::vector<cmd_params_instance> get_cmd_params_instances(const cmd_param
                 /* .type_v       = */ tv,
                 /* .n_threads    = */ nt,
                 /* .n_gpu_layers = */ nl,
-                /* .rpc_servers  = */ rpc,
                 /* .split_mode   = */ sm,
                 /* .main_gpu     = */ mg,
                 /* .no_kv_offload= */ nkvo,
@@ -754,6 +691,7 @@ struct test {
     static const std::string build_commit;
     static const int build_number;
     static const bool cuda;
+    static const bool opencl;
     static const bool vulkan;
     static const bool kompute;
     static const bool metal;
@@ -769,7 +707,6 @@ struct test {
     int n_batch;
     int n_ubatch;
     int n_threads;
-    bool has_rpc;
     ggml_type type_k;
     ggml_type type_v;
     int n_gpu_layers;
@@ -786,7 +723,7 @@ struct test {
     std::vector<uint64_t> samples_ns;

     test(const cmd_params_instance & inst, const llama_model * lmodel, const llama_context * ctx) {
-        model_filename = inst.model;
+        model_filename = basename(strdup(inst.model.c_str()));  // [jart]
         char buf[128];
         llama_model_desc(lmodel, buf, sizeof(buf));
         model_type = buf;
@@ -795,7 +732,6 @@ struct test {
         n_batch = inst.n_batch;
         n_ubatch = inst.n_ubatch;
         n_threads = inst.n_threads;
-        has_rpc = !inst.rpc_servers.empty();
         type_k = inst.type_k;
         type_v = inst.type_v;
         n_gpu_layers = inst.n_gpu_layers;
@@ -843,6 +779,9 @@ struct test {
         if (cuda) {
             return GGML_CUDA_NAME;
         }
+        if (opencl) {
+            return "OpenCL";
+        }
         if (vulkan) {
             return "Vulkan";
         }
@@ -852,9 +791,9 @@ struct test {
         if (metal) {
             return "Metal";
         }
-        if (sycl) {
-            return GGML_SYCL_NAME;
-        }
+        // if (sycl) {
+        //     return GGML_SYCL_NAME;
+        // }
         if (gpu_blas) {
             return "GPU BLAS";
         }
@@ -868,7 +807,7 @@ struct test {
     static const std::vector<std::string> & get_fields() {
         static const std::vector<std::string> fields = {
             "build_commit", "build_number",
-            "cuda", "vulkan", "kompute", "metal", "sycl", "rpc", "gpu_blas", "blas",
+            "cuda", "opencl", "vulkan", "kompute", "metal", "sycl", "gpu_blas", "blas",
             "cpu_info", "gpu_info",
             "model_filename", "model_type", "model_size", "model_n_params",
             "n_batch", "n_ubatch",
@@ -894,7 +833,7 @@ struct test {
             field == "avg_ns" || field == "stddev_ns") {
             return INT;
         }
-        if (field == "cuda" || field == "vulkan" || field == "kompute" || field == "metal" ||
+        if (field == "cuda" || field == "opencl"  || field == "vulkan" || field == "kompute" || field == "metal" ||
             field == "gpu_blas" || field == "blas" || field == "sycl" ||field == "f16_kv" || field == "no_kv_offload" ||
             field == "flash_attn" || field == "use_mmap" || field == "embeddings") {
             return BOOL;
@@ -923,8 +862,8 @@ struct test {
         }
         std::vector<std::string> values = {
             build_commit, std::to_string(build_number),
-            std::to_string(cuda), std::to_string(vulkan), std::to_string(vulkan),
-            std::to_string(metal), std::to_string(sycl), std::to_string(has_rpc), std::to_string(gpu_blas), std::to_string(blas),
+            std::to_string(cuda), std::to_string(opencl), std::to_string(vulkan), std::to_string(vulkan),
+            std::to_string(metal), std::to_string(sycl), std::to_string(gpu_blas), std::to_string(blas),
             cpu_info, gpu_info,
             model_filename, model_type, std::to_string(model_size), std::to_string(model_n_params),
             std::to_string(n_batch), std::to_string(n_ubatch),
@@ -951,15 +890,16 @@ struct test {

 const std::string test::build_commit = LLAMA_COMMIT;
 const int         test::build_number = LLAMA_BUILD_NUMBER;
-const bool        test::cuda         = !!ggml_cpu_has_cuda();
-const bool        test::vulkan       = !!ggml_cpu_has_vulkan();
-const bool        test::kompute      = !!ggml_cpu_has_kompute();
-const bool        test::metal        = !!ggml_cpu_has_metal();
-const bool        test::gpu_blas     = !!ggml_cpu_has_gpublas();
-const bool        test::blas         = !!ggml_cpu_has_blas();
-const bool        test::sycl         = !!ggml_cpu_has_sycl();
-const std::string test::cpu_info     = get_cpu_info();
-const std::string test::gpu_info     = get_gpu_info();
+const bool        test::cuda         = false; // !!ggml_cpu_has_cuda(); // [jart]
+const bool        test::opencl       = false; // !!ggml_cpu_has_clblast(); // [jart]
+const bool        test::vulkan       = false; // !!ggml_cpu_has_vulkan(); // [jart]
+const bool        test::kompute      = false; // !!ggml_cpu_has_kompute(); // [jart]
+const bool        test::metal        = false; // !!ggml_cpu_has_metal(); // [jart]
+const bool        test::gpu_blas     = false; // !!ggml_cpu_has_gpublas(); // [jart]
+const bool        test::blas         = false; // !!ggml_cpu_has_blas(); // [jart]
+const bool        test::sycl         = false; // !!ggml_cpu_has_sycl(); // [jart]
+const std::string test::cpu_info     = llamafile_describe_cpu();
+const std::string test::gpu_info     = ""; //get_gpu_info(); // [jart]

 struct printer {
     virtual ~printer() {}
@@ -1067,7 +1007,13 @@ struct markdown_printer : public printer {
             return -30;
         }
         if (field == "t/s") {
-            return 16;
+            return 15; // [jart]
+        }
+        if (field == "cpu_info") {
+            return test::cpu_info.size(); // [jart]
+        }
+        if (field == "model_filename") {
+            return 40; // [jart]
         }
         if (field == "size" || field == "params") {
             return 10;
@@ -1075,27 +1021,6 @@ struct markdown_printer : public printer {
         if (field == "n_gpu_layers") {
             return 3;
         }
-        if (field == "n_threads") {
-            return 7;
-        }
-        if (field == "n_batch") {
-            return 7;
-        }
-        if (field == "n_ubatch") {
-            return 8;
-        }
-        if (field == "type_k" || field == "type_v") {
-            return 6;
-        }
-        if (field == "split_mode") {
-            return 5;
-        }
-        if (field == "flash_attn") {
-            return 2;
-        }
-        if (field == "use_mmap") {
-            return 4;
-        }
         if (field == "test") {
             return 13;
         }
@@ -1138,17 +1063,19 @@ struct markdown_printer : public printer {

     void print_header(const cmd_params & params) override {
         // select fields to print
-        fields.emplace_back("model");
-        fields.emplace_back("size");
-        fields.emplace_back("params");
-        fields.emplace_back("backend");
+        fields.emplace_back("cpu_info"); // [jart]
+        fields.emplace_back("model_filename");
+        // fields.emplace_back("model");
+        fields.emplace_back("size"); // [jart]
+        // fields.emplace_back("params"); // [jart]
+        // fields.emplace_back("backend"); // [jart]
         bool is_cpu_backend = test::get_backend() == "CPU" || test::get_backend() == "BLAS";
         if (!is_cpu_backend) {
             fields.emplace_back("n_gpu_layers");
         }
-        if (params.n_threads.size() > 1 || params.n_threads != cmd_params_defaults.n_threads || is_cpu_backend) {
-            fields.emplace_back("n_threads");
-        }
+        // if (params.n_threads.size() > 1 || params.n_threads != cmd_params_defaults.n_threads || is_cpu_backend) {
+        //     fields.emplace_back("n_threads");
+        // }
         if (params.n_batch.size() > 1 || params.n_batch != cmd_params_defaults.n_batch) {
             fields.emplace_back("n_batch");
         }
@@ -1206,7 +1133,7 @@ struct markdown_printer : public printer {
             std::string value;
             char buf[128];
             if (field == "model") {
-                value = t.model_type;
+              value = t.model_type;
             } else if (field == "size") {
                 if (t.model_size < 1024*1024*1024) {
                     snprintf(buf, sizeof(buf), "%.2f MiB", t.model_size / 1024.0 / 1024.0);
@@ -1223,9 +1150,6 @@ struct markdown_printer : public printer {
                 value = buf;
             } else if (field == "backend") {
                 value = test::get_backend();
-                if (t.has_rpc) {
-                    value += "+RPC";
-                }
             } else if (field == "test") {
                 if (t.n_prompt > 0 && t.n_gen == 0) {
                     snprintf(buf, sizeof(buf), "pp%d", t.n_prompt);
@@ -1236,27 +1160,28 @@ struct markdown_printer : public printer {
                 }
                 value = buf;
             } else if (field == "t/s") {
-                snprintf(buf, sizeof(buf), "%.2f ± %.2f", t.avg_ts(), t.stdev_ts());
+                // snprintf(buf, sizeof(buf), "%.2f ± %.2f", t.avg_ts(), t.stdev_ts()); // [jart]
+                snprintf(buf, sizeof(buf), "%.2f", t.avg_ts());
                 value = buf;
             } else if (vmap.find(field) != vmap.end()) {
-                value = vmap.at(field);
+                value = replace_all(replace_all(vmap.at(field), ".gguf", ""), ".llamafile", ""); // [jart]
             } else {
                 assert(false);
                 exit(1);
             }

             int width = get_field_width(field);
-            if (field == "t/s") {
-                // HACK: the utf-8 character is 2 bytes
-                width += 1;
-            }
+            // if (field == "t/s") { // [jart]
+            //     // HACK: the utf-8 character is 2 bytes
+            //     width += 1;
+            // }
             fprintf(fout, " %*s |", width, value.c_str());
         }
         fprintf(fout, "\n");
     }

     void print_footer() override {
-        fprintf(fout, "\nbuild: %s (%d)\n", test::build_commit.c_str(), test::build_number);
+        // fprintf(fout, "\nbuild: %s (%d)\n", test::build_commit.c_str(), test::build_number); // [jart]
     }
 };

@@ -1342,29 +1267,24 @@ static void llama_null_log_callback(enum ggml_log_level level, const char * text
     (void) user_data;
 }

-static std::unique_ptr<printer> create_printer(output_formats format) {
-    switch (format) {
-        case NONE:
-            return nullptr;
-        case CSV:
-            return std::unique_ptr<printer>(new csv_printer());
-        case JSON:
-            return std::unique_ptr<printer>(new json_printer());
-        case MARKDOWN:
-            return std::unique_ptr<printer>(new markdown_printer());
-        case SQL:
-            return std::unique_ptr<printer>(new sql_printer());
-    }
-    GGML_ABORT("fatal error");
+__attribute__((__constructor__(101))) static void init(void) {
+    FLAG_gpu = LLAMAFILE_GPU_DISABLE; // [jart]
 }

 int main(int argc, char ** argv) {
+    ShowCrashReports();
+
     // try to set locale for unicode characters in markdown
-    setlocale(LC_CTYPE, ".UTF-8");
+    setlocale(LC_CTYPE, "C.UTF-8");  // [jart]

-#if !defined(NDEBUG)
-    fprintf(stderr, "warning: asserts enabled, performance may be affected\n");
-#endif
+    __warn_if_powersave();  // [jart]
+    if (!getenv("LLAMAFILE_TEMPERATURE_FILE") || !getenv("LLAMAFILE_TEMPERATURE_MAX"))
+        fprintf(stderr, "warning: don't know how to govern your cpu temperature; "
+                "consider setting the environment variables described in llamafile/govern.cpp\n");
+
+// #if !defined(NDEBUG)
+//     fprintf(stderr, "warning: asserts enabled, performance may be affected\n");
+// #endif

 #if (defined(_MSC_VER) && defined(_DEBUG)) || (!defined(_MSC_VER) && !defined(__OPTIMIZE__))
     fprintf(stderr, "warning: debug build, performance may be affected\n");
@@ -1375,6 +1295,7 @@ int main(int argc, char ** argv) {
 #endif

     cmd_params params = parse_cmd_params(argc, argv);
+    FLAGS_READY = true;

     // initialize llama.cpp
     if (!params.verbose) {
@@ -1384,18 +1305,26 @@ int main(int argc, char ** argv) {
     llama_numa_init(params.numa);

     // initialize printer
-    std::unique_ptr<printer> p = create_printer(params.output_format);
-    std::unique_ptr<printer> p_err = create_printer(params.output_format_stderr);
-
-    if (p) {
-        p->fout = stdout;
-        p->print_header(params);
-    }
-
-    if (p_err) {
-        p_err->fout = stderr;
-        p_err->print_header(params);
+    std::unique_ptr<printer> p;
+    switch (params.output_format) {
+        case CSV:
+            p.reset(new csv_printer());
+            break;
+        case JSON:
+            p.reset(new json_printer());
+            break;
+        case MARKDOWN:
+            p.reset(new markdown_printer());
+            break;
+        case SQL:
+            p.reset(new sql_printer());
+            break;
+        default:
+            assert(false);
+            exit(1);
     }
+    p->fout = stdout;
+    p->print_header(params);

     std::vector<cmd_params_instance> params_instances = get_cmd_params_instances(params);

@@ -1440,6 +1369,8 @@ int main(int argc, char ** argv) {
         for (int i = 0; i < params.reps; i++) {
             llama_kv_cache_clear(ctx);

+            llamafile_govern(); // [jart] see docs in llamafile/govern.cpp
+
             uint64_t t_start = get_time_ns();

             if (t.n_prompt > 0) {
@@ -1453,15 +1384,7 @@ int main(int argc, char ** argv) {
             t.samples_ns.push_back(t_ns);
         }

-        if (p) {
-            p->print_test(t);
-            fflush(p->fout);
-        }
-
-        if (p_err) {
-            p_err->print_test(t);
-            fflush(p_err->fout);
-        }
+        p->print_test(t);

         llama_print_timings(ctx);

@@ -1470,13 +1393,7 @@ int main(int argc, char ** argv) {

     llama_free_model(lmodel);

-    if (p) {
-        p->print_footer();
-    }
-
-    if (p_err) {
-        p_err->print_footer();
-    }
+    p->print_footer();

     llama_backend_free();

diff --git llama.cpp/llama-grammar.cpp llama.cpp/llama-grammar.cpp
index b123d73..18deeb8 100644
